<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
namespace S3\Sample1Bundle\EventListener;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
/**
 * Description of PageLoadListener
 *
 * @author minh.ton
 */
class PageLoadListener extends Controller{
    private $securityContext;
    protected $container;
    protected $query;
    
    public function __construct(SecurityContext $context, $container, $query) {
        $this->securityContext = $context;
        $this->container = $container;
        $this->query = $query;
    }
    
    public function onKernelRequest(GetResponseEvent $event)
    {
        var_dump('go to the onKernelRequest function');#exit;
        // do the logic
        $request = $event->getRequest();
        
        $response = $event->getResponse();
        $session = $request->getSession();
    }
}